﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using System.Web.UI;
//using DevExpress.Web.ASPxGridView;
//using System.Web.UI.HtmlControls;
//using MLY.Dal;

//namespace MLY
//{
//  // Prevent word warp in grid columns. 
//  // If the text is too long then truncate it and add "..." at the end.
//  public class InventoryDivTemplate : ITemplate
//  {
//    private string mFieldName;

//    public InventoryDivTemplate(string fieldName)
//    {
//      mFieldName = fieldName;
//    }

//    void ITemplate.InstantiateIn(Control container)
//    {
//      GridViewDataItemTemplateContainer gridContainer = (GridViewDataItemTemplateContainer)container;
//      object rowValue = gridContainer.Grid.GetRowValues(gridContainer.ItemIndex, mFieldName);
//      if (rowValue != null)
//      {
//        HtmlGenericControl div = new HtmlGenericControl();
//        div.TagName = "div";
//        //div.Style["text-overflow"] = "ellipsis";
//        //div.Style["overflow"] = "hidden";
//        div.Style["white-space"] = "nowrap";
//        div.InnerText = rowValue.ToString();
//        container.Controls.Add(div);
//      }
//    }
//  }

//}
